package com.hghivln.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hghivln.pojo.domain.Medicines;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface MedicinesMapper extends BaseMapper<Medicines> {

    int deleteMedicinesByIds(List<Long> idList);

    /**
     * 调整库存
     */
    int updateMedicinesStorage(@Param("medicinesId") Long medicinesId, @Param("medicinesStockNum") Long medicinesStockNum);

    /**
     * 库存扣减
     * @param medicinesId 药品ID
     * @param num 扣减的量
     * @return int
     */
    int deductionMedicinesStorage(@Param("medicinesId") Long medicinesId,@Param("num") Long num);
}